<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	</head>
	<body>
		<script>
			Vue.filter('reverseStr', function(value) {//翻转内容
			    return value.split('').reverse().join('');
			});
		
			
			 Vue.filter('uppercase', function(value) {//大写
		      if (!value) { return ''}
		      value = value.toString();
		      return value.toUpperCase();
		    });
		
		    Vue.filter('lowercase', function(value) {//小写
		      if (!value) { return ''}
		      value = value.toString();
		      return value.toLowerCase();
		    });
		
		    Vue.filter('capitalize', function(value) {//首字母大写
		      if (!value) { return ''}
		      value = value.toString()
		      return value.charAt(0).toUpperCase() + value.slice(1);
		    });
		
		    Vue.filter('currency',function(val,i,n){//变成钱
		        var num = parseFloat(val).toFixed(n || 2);
		        var re = /(\d{1,3})(?=(\d{3})+(?:\.))/g;
		        var s = (i || "$") + num.replace(re, "$1,");
		        return s;
		    })
			
		</script>
	</body>
</html>